package cn.codeforfun.user.controller;

import cn.codeforfun.common.model.Role;
import com.jfinal.core.Controller;

import java.util.List;

/**
 * Created by P0015475 on 2016/8/8.
 */
public class RoleController extends Controller {
    public void list() {
        List<Role> roles = Role.dao.find("select * from role");
        setAttr("data", roles);
        renderJson();
    }

    public void get() {
        Integer id = getParaToInt("id");
        Role role = Role.dao.findById(id);
        setAttr("data", role);
        renderJson();
    }
}
